js replace quotes

68

js replace quotes -

mystring = mystring.replace(/["']/g, "");

javascript replace doublequote with empty string -

const anyStr = 'Friend ... "OK" ... foo'
const formattedString = anyStr.replace(/["]/g, "\\"")

Comments

Submit
0 Comments